# -*- coding: utf-8 -*-
from django import forms
from mysite import models
from captcha.fields import CaptchaField

class ContactForm(forms.Form):
	CITY=[
		['TP','TiPei'],
		['HK','HonKon'],
		['ML','MainLand'],
		['MC','MaCau'],
		['NA','Other']
	]
	user_name = forms.CharField(label='您的名字',max_length=50,initial='请输入您的名字')
	user_city = forms.ChoiceField(label='居住城市',choices=CITY)
	user_school = forms.BooleanField(label='是否在学',required=False)
	user_email = forms.EmailField(label='电子邮件')
	user_message = forms.CharField(label='您的意见',widget=forms.Textarea)
	
class PostForm(forms.ModelForm):
	captcha = CaptchaField()
	class Meta:
		model = models.Post
		fields = ['mood','nickname','message','del_pass']
		
	def __init__(self,*args,**kwargs):
		super(PostForm,self).__init__(*args,**kwargs)
		self.fields['mood'].label='现在心情'
		self.fields['nickname'].label='你的昵称'
		self.fields['message'].label='心情留言'
		self.fields['del_pass'].label='设定密码'
		self.fields['captcha'].label='请输入验证码'
	
class LoginForm(forms.Form):
	# COLORS=[
		# ['Red','红色'],
		# ['Orange','橙色'],
		# ['Yellow','黄色'],
		# ['Green','绿色'],
		# ['Blue','蓝色'],
		# ['Dian','靛色'],
		# ['Purpose','紫色']
	# ]
	# user_color = forms.ChoiceField(label='幸运色',choices=COLORS)
	username = forms.CharField(label='君の名',max_length = 10)
	password = forms.CharField(label='命運zhi碼',widget=forms.PasswordInput())